from django.shortcuts import render, get_object_or_404
from module.models import Module

from api.views import error, render

def list_(request):
    module_list = Module.objects.filter(enabled=True)
    return render({"module_list": module_list})


def download(request):
    module_id = request.GET.get('id')
    module = get_object_or_404(Module, pk=module_id)
    return render({"module": module})

